const TOKEN_KEY = 'accessToken'
const USERINFO_KEY = 'userInfo'
// const STATUS_KEY = 'status'

// 保存 token
export function setToken (accessToken) {
  return localStorage.setItem(TOKEN_KEY, accessToken)
}

// 获取 token
export function getToken () {
  return localStorage.getItem(TOKEN_KEY)
}

// 保存 userInfo
export function setUserInfo (userInfo) {
  return localStorage.setItem(USERINFO_KEY, JSON.stringify(userInfo))
}

// 获取 userInfo
export function getUserInfo () {
  return JSON.parse(localStorage.getItem(USERINFO_KEY))
}

// 移除用户信息
export function removeToken () {
  localStorage.removeItem(TOKEN_KEY)
}

// 移除status
export function removeUserInfo () {
  localStorage.removeItem(USERINFO_KEY)
}
